home *** CD-ROM | disk | FTP | other *** search
- {FaceIt 2.04 Demonstration Program}
- {©FaceWare 1989-92. All Rights Reserved.}
- {C1 - run program to see on-line comments}
- program fDemoLP;
- {$I-}
-
- {C2}
- uses
- FaceStorLP, FaceProcLP;
- var
- i, mode: integer;
- oldCount, newCount: longint;
- keys: KeyMap;
- fileName: Str255;
-
- begin
- with fRec do
- begin
- {C3}
- uName := 'fDemo.Rsrc';
- {C4,5}
- FaceIt(nil, DoInit, 515, 0, 0, 0);
- {C6}
- FaceIt(nil, NewWnd, 1030, 1, 0, 0);
- {C7}
- repeat
- FaceIt(nil, DoLoop, 0, 0, 0, 0);
- {C8}
- case uMenuID of
- {C9}
- 101:
- if (uMenuItem = 1) then
- begin
- uString := concat('Demonstration of the use of FaceIt', chr(13), 'to support program-wide features.');
- FaceIt(nil, ShoStr, 3, 12, 1 + (409 * 65536), 0);
- end;
- {C10}
- 105, 106, 107:
- {C11}
- case uMenuItem of
- 1:
- SysBeep(5);
- 2:
- begin
- SysBeep(5);
- SysBeep(5);
- end;
- 3:
- begin
- SysBeep(5);
- SysBeep(5);
- SysBeep(5);
- end;
- {C12}
- 8:
- begin
- {C13}
- FaceIt(nil, ShoAlt, 1010, 0, 1, 1);
- mode := uResult;
- oldCount := 0;
- if (mode > 1) then
- while true do
- begin
- {C14}
- newCount := TickCount;
- if (newCount - oldCount > 180) then
- begin
- SysBeep(5);
- oldCount := newCount;
- end;
- {C15}
- if (mode = 2) then
- if GetNextEvent(-1, fEvent) then
- if (fEvent.what = 6) or (fEvent.what = 15) then
- FaceIt(nil, DoEvnt, 0, 0, 0, 0)
- else if (fEvent.what = 5) then
- leave;
- {C16}
- if (mode = 3) then
- begin
- GetKeys(keys);
- if BitTst(@keys, 61) and BitTst(@keys, 48) then
- begin
- FlushEvents(62, 0);
- leave;
- end;
- end;
- end;
- end;
- otherwise
- end;
- {C17}
- 1030:
- begin
- if (wcHit > 3) then
- begin
- FaceIt(nil, GetCtl, 1030, 0, 1, 4);
- FaceIt(nil, PopMen, 107, cRect.top - 5, cRect.left - 11, 0);
- wcHit := uMenuItem;
- end;
- if (wcHit > 0) then
- for i := 1 to wcHit do
- SysBeep(5);
- end;
- {C18}
- 1100:
- if (uMenuItem = 2) then
- begin
- if (fActiveWnd = nil) then
- uString := 'No Window'
- else if (fActiveID <> 1200) then
- uString := 'Non-ViewIt Window'
- else if (fActiveResID = 1010) then
- uString := 'Editor Window'
- else if (fActiveResID = 1020) then
- uString := 'Clipboard Window'
- else if (fActiveResID = 1030) then
- uString := 'Beeps Window';
- FaceIt(nil, SetItm2, 105, 10, 3, 0);
- end
- {C19}
- else if (uMenuItem = 512) then
- if (uString = 'TEXT') and (uResult = 1) then
- begin
- fileName := uName;
- FaceIt(nil, GetCtl, 1010, 0, 1, 1);
- uName := fileName;
- FaceIt(cControl, 1551, 0, 1, 0, 0); {OpnCTxt}
- end;
- otherwise
- end;
- until false;
-
- end;
- end.